home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir36 / sw_46.zip / SW46DEMO.BAT < prev    next >
DOS Batch File  |  1993-11-07  |  6KB  |  221 lines

  1. @ECHO OFF
  2. if not %1!==! goto %1
  3.  
  4. : REM A pre-SW screen just for effect
  5. : REM make sure the screen is default white on black
  6. : REM reset border
  7. sw /o
  8. : REM save existing prompt
  9. set sav=%prompt%
  10. : REM make sure there was room in environment
  11. if not %sav%!==%prompt%! goto skip
  12. set prompt=$e[0m$p$g
  13. @echo on
  14. cls
  15. @echo off
  16.  echo.
  17.  echo.
  18.  echo.
  19.  echo.
  20.  echo.
  21.  echo.
  22.  echo.
  23.  echo                           Are Your Batch Files Dull?
  24.  echo.
  25.  echo                                    Lifeless?
  26.  echo.
  27.  echo                                     Boring?
  28.  echo.
  29.  echo                          SCREEN WIZARD is the answer!
  30.  echo.
  31.  echo.
  32.  echo.
  33.  echo.
  34.  echo.
  35.  echo.
  36.  echo.
  37.  echo.
  38.  pause
  39.  set prompt=%sav%
  40.  set sav=
  41.  
  42. :skip
  43. : REM skip over beepdemo labels
  44. : REM Put screen definitions in a separate file
  45. goto begin
  46.  
  47. : REM labels for Alert sounds demos near the beginning of file 
  48. : REM for faster execution
  49.  
  50. :beep1
  51.  sw /a1
  52.  goto BeepDemo
  53.  
  54. :beep2
  55.  sw /a2
  56.  goto BeepDemo
  57.  
  58. :beep3
  59.  sw /a3
  60.  goto BeepDemo
  61.  
  62. :beep4
  63.  sw /a4
  64.  goto BeepDemo
  65.  
  66. :beep5
  67.  sw /a5
  68.  goto BeepDemo
  69.  
  70. :beep6
  71.  sw /a6
  72.  goto BeepDemo
  73.  
  74. :beep7
  75.  sw /a7
  76.  goto BeepDemo
  77.  
  78. :beep8
  79.  sw /a8
  80.  goto BeepDemo
  81.  
  82. :beep9
  83.  sw /a9
  84.  goto beepdemo
  85.  
  86. :beep10
  87.  sw @sw46demo charge
  88.  goto beepdemo
  89.  
  90. :beep11
  91.  sw @sw46demo close
  92.  goto beepdemo
  93.  
  94. :beep12
  95.  sw @sw46demo Fifth
  96.  goto beepdemo
  97.  
  98. :beep13
  99.  sw @sw46demo WZLX
  100.  goto beepdemo
  101.  
  102. :beep14
  103.  sw /a110-3520,12
  104.  goto beepdemo
  105.  
  106. :beep15
  107.  sw /a3520-110,6
  108.  goto beepdemo
  109.  
  110. : REM Alternate errorlevel check using FOR loop
  111.  
  112. :beepdemo
  113. : REM Query is handled in a separate screen def so that I won't waste time
  114. : REM redrawing the menu after each sound.
  115.  
  116.  sw @sw46demo Snd_Query
  117.  
  118. : REM Errorlevels checked by FOR IN DO loop makes for a short line but
  119. : REM slower processing
  120.  
  121.  for %%e in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) do if errorlevel %%e goto beep%%e
  122.  if not errorlevel 1 goto DI
  123.  goto beepdemo
  124.  
  125. : REM Command line examples, positioning, colors, shadows, pause, Wide edge
  126. : REM Color numbers are used to shorten the line
  127. : REM Command line cannot exceed 128 characters
  128.  
  129. :begin
  130.  sw /r125 /c180 /z /l0 " " /bwhi
  131.  sw /kwhi[_] /kred /r2 /s /bred "SCREEN WIZARD - Enhance Your Batch Files!" /0 /w /m " v 4.6 " /o /z
  132.  sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
  133.  sw /r18 /l3 /t11 "Display up to 50 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
  134.  sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  135.  
  136. : REM More command line examples, justify, borders
  137.  
  138.  sw /kcya░ /r2 /s /bred "SCREEN WIZARD - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.6 " /z
  139.  sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
  140.  sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for fill" "& make windows with shadows." /0 /s
  141.  sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
  142.  sw /bwhi /r19 /gyel /l0 /0 /c68 /jr " Justify " "Text " "Right "
  143.  sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  144.  
  145.  set colr=bla
  146. : REM Make sure there was room in the environment
  147.  if not "%colr%"=="bla" goto next
  148.  
  149. : REM Another command line example, Query with default, Border Message, Draw
  150. : REM Draw a full screen window
  151.  sw /r125 /c180 /o1 " "
  152.  sw /r3 /s /bred "SCREEN WIZARD - Flow Control for BAT's!" /w /0 /m " v 4.6 " /z
  153.  
  154. : REM The following line is longer than 128 characters BUT it works because 
  155. : REM when the line is processed by DOS, the %colr% variable is replaced by
  156. : REM the color value making the command line 3 characters shorter.
  157.  
  158. :colors
  159.  sw /e12 /r13 /b%colr% /s /m /t14 "▌ Pick a Color ▐" "~Brown  ~Cyan  ~White  ~Green" "Press {ESC} to go on..." /q~bcwg /2 /l5 /d
  160.  
  161.  if errorlevel 4 set colr=gre
  162.  if errorlevel 4 goto colors
  163.  if errorlevel 3 set colr=whi
  164.  if errorlevel 3 goto colors
  165.  if errorlevel 2 set colr=cya
  166.  if errorlevel 2 goto colors
  167.  if errorlevel 1 set colr=yel
  168.  if errorlevel 1 goto colors
  169.  
  170. :next
  171.  set colr=
  172.  
  173. : REM Display screen definition with default label
  174.  sw @sw46demo
  175.  
  176. : REM Display screen definition in external file
  177.  sw @sw-46.new
  178.  
  179. : REM Display screen definition with label 'Snd_menu'
  180.  sw @sw46demo Snd_menu
  181.  
  182. : REM Query is handled separately beacause I wanted to return to the menu
  183. : REM after processing the response without redoing the screen.
  184. : REM I also placed it nearer the top of the file to speed it up.
  185.  goto beepdemo
  186.  
  187. : REM create screen definition on the fly to demo DI.EXE
  188. :DI
  189.  if exist di.hlp goto DI_Display
  190.  sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
  191.  echo : REM This file was created by SW46DEMO.BAT > di.hlp
  192.  echo : REM If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
  193.  echo : REM                       "SW @DI.HLP" >> di.hlp
  194.  echo.>> di.hlp
  195.  echo :Display >> di.hlp
  196.  echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
  197.  echo SCREEN WIZARD - Now with DI!>> di.hlp
  198.  echo /mc  v 4.6 >> di.hlp
  199.  echo _window /jl /s /0 /r9 >> di.hlp
  200.  echo /mc  Disk Information >> di.hlp
  201.  echo.>> di.hlp
  202.  di >> di.hlp
  203.  echo. >> di.hlp
  204.  echo /m /eYEL "~╡ Press any key to continue ~╞">> di.hlp
  205.  echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
  206.  echo :End_Display >> di.hlp
  207.  
  208. :DI_Display
  209.  sw @di.hlp
  210.  
  211. : REM Display screen definition with label '4.6'
  212. :final
  213.  sw @sw46demo 4.6
  214.  for %%t in (10 9 8 7 6 5 4 3 2 1) do sw /r25 /l0 /0 /a10000,1 /p8- " - Pausing %%t seconds - " /@-
  215.  sw /r25 /l0 /0 /a60,1 /p2 " - Outta Here! - "
  216.  if exist sw-big.sw sw @sw-big
  217.  
  218. : REM display help screen
  219. :help
  220.  sw
  221.